home *** CD-ROM | disk | FTP | other *** search
Makefile | 1997-03-04 | 2.4 KB | 110 lines | [TEXT/unix] |
- # Makefile
- # to build and test my working environment
- # (including my i/o library and an arithmetic coding classlib)
- #
- # To build the library, you may want to edit the list of the library modules
- # below (MODULES). Say, if you don't need/want voc, remove all the names
- # that contain voc from MODULES= below. Then make the modules you left
- # into the library by
- # make lib
- # simple 'make' would suffice, too.
- #
- # To verify the library, do
- # make check-all
- # or, more specifically,
- # make vmyenv (checks myemnv utility functions)
- # make vendian_io (checks Endion I/O and bitstream i/o)
- # make varithm (checks arithmetic compression/decompression)
- # make vhistogram (checks histogram operations)
- #
- # Note, this Makefile was built (and works under) GNU make 3.71
- #
- # Please check RANLIB below and adjust it to your system if necessary
- # (it was made for a BSD-like system)
- #
- CC=$(HOME)/bin/c++
- CCL=$(HOME)/bin/c++l
- .SUFFIXES: .cc
- MODULES=sys_open.cc filebuf.cc myenv.cc endian_io.cc \
- arithm_coding.cc arithm_model.cc arithm_modadapt.cc \
- arithm_modadh.cc histogram.cc \
- voc.cc voc_io.cc
-
- LIBRARY=libserv.a
- #RANLIB = (ar d $(LIBRARY) __.SYMDEF || true); ranlib $(LIBRARY) # for BSD
- RANLIB = /bin/true # for Solaris 2.x, HP/UX and other SysV-based
-
-
- # Rules, new style
-
- %.o : %.cc
- $(CC) $*.cc
-
- % : %.o $(LIBRARY)
- $(CCL) $< $(LIBRARY) -o $@
- ./$@
-
- % :: %.cc
- $(CC) $*.cc
- $(CCL) $*.o $(LIBRARY) -o $@
- ./$@
-
- # Rules, old style
- #.o: $*.o $(LIBRARY)
- # $(CCL) $*.o $(LIBRARY) -o $*
- # ./$*
- #.cc: $*.cc $(LIBRARY)
- # $(CC) $*.cc
- # $(CCL) $*.o $(LIBRARY) -o $*
- # ./$*
- #.cc.o:
- # $(CC) $*.cc
- #
-
- # Primary goal
-
- # Library
-
- lib: $(LIBRARY)
- .PHONY: lib
- .PRECIOUS: $(LIBRARY)
-
- $(LIBRARY):: $(MODULES)
- # Compile the source files that have been changed
- $(CC) $?
- listobj=`echo $? | sed s/.cc/.o/g` ; \
- ar rv $(LIBRARY) $$listobj && \
- rm $$listobj
- $(RANLIB)
-
- # Verification routines
- check-all: vmyenv vendian_io varithm vhistogram
-
- clean:
- rm -f core vmyenv.o vmyenv vendian_io.o vendian_io varithm.o varithm \
- vhistogram.o vhistogram
-
- dist-clean: clean
- rm -f $(LIBRARY)
-
- #vendian_io: vendian_io.o $(LIBRARY)
- # $(CCL) vendian_io.o $(LIBRARY) -o vendian_io
- # ./vendian_io
-
- # Specific dependent goals
-
-
- # Dependence rules
-
- $(LIBRARY):: myenv.h
- $(MAKE) -W myenv.cc lib
-
- vendian_io.o: endian_io.h
-
- $(LIBRARY):: arithm.h
- $(MAKE) -W arithm_coding.cc lib
- $(MAKE) -W arithm_model.cc lib
- $(LIBRARY):: arithm.h arithm_modadh.h
- $(MAKE) -W arithm_modadh.cc lib
-
-